// 文件位置: PersonalFinanceManager/src/main/java/FinanceManager.java

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class FinanceManager {
    private List<FinanceRecord> incomes = new ArrayList<>();
    private List<FinanceRecord> expenses = new ArrayList<>();

    public void addIncome(Date date, double amount, String category, String remark) {
        if (amount > 0) {
            incomes.add(new FinanceRecord(date, amount, category, remark));
        } else {
            throw new IllegalArgumentException("Income amount must be positive.");
        }
    }

    public void addExpense(Date date, double amount, String category, String remark) {
        if (amount > 0) {
            expenses.add(new FinanceRecord(date, amount, category, remark));
        } else {
            throw new IllegalArgumentException("Expense amount must be positive.");
        }
    }

    // Methods to retrieve records could be added here
}

